home *** CD-ROM | disk | FTP | other *** search
/ Programmer Plus 2007 / Programmer-Plus-2007.iso / Programming / Borland Plateform / TURBO PASCAL 1.5 for WIN / TDWDOC.PAK / HELPME!.TDW < prev    next >
Encoding:
Text File  |  1992-06-08  |  9.3 KB  |  212 lines

  1.         TURBO DEBUGGER FOR WINDOWS TIPS AND HINTS
  2.             
  3.  
  4. CONTENTS:
  5. 1.  Turbo Debugger for Windows (TDW) Windows debugging hints
  6. 2.  TDW mouse support
  7. 3.  Answers to common questions
  8.  
  9.  
  10. 1. Turbo Debugger for Windows (TDW), Windows debugging hints
  11. ------------------------------------------------------------
  12.   View|Windows Messages
  13.  
  14.       If you set up View|Windows Messages to display messages for
  15.       more than one procedure or handle or both, do not log all
  16.       messages.  Instead, log specific messages for each procedure or
  17.       handle.  If you log all messages, the system might hang, in
  18.       which case you will have to reboot to continue.  This behavior
  19.       is due to the large number of messages being transferred
  20.       between Windows and TDW.
  21.  
  22.       When setting a break on the Mouse class of messages, note that
  23.       a "mouse down" message must be followed by a "mouse up" message
  24.       before the keyboard will become active again.  When you return
  25.       to the application, you might have to press the mouse button
  26.       several times to get Windows to receive a "mouse up" message.
  27.       You'll know Windows has received the message when you see it in the
  28.       bottom pane of the Windows Message window after the program breaks.
  29.  
  30.       If you enter a handle name but indicate that it's a
  31.       procedure, TDW will accept your input and will not complain. 
  32.       However, when you run your program, TDW will not log any
  33.       messages.  If TDW is not logging messages when you think you've
  34.       set a handle, check the Add Window dialog box of the top left pane of
  35.       the Windows Messages window to see if you've pressed the Handle button.
  36.  
  37.   View|Module
  38.  
  39.       The Debug Startup radio buttons are used for DLLs only.  To
  40.       debug EXE startup, begin TDW with the Assembler-mode Startup
  41.       command-line option (-l).
  42.  
  43.       When a program loaded into TDW is reset, the Load symbols
  44.       radio buttons default to YES for all DLLs and applications
  45.       with symbols, even if you specified NO for a given DLL or
  46.       application prior to resetting the program.
  47.  
  48.        
  49. 2. TDW mouse support
  50. --------------------
  51.   TDW provides mouse support that allows you to manipulate 
  52.   elements of the user interface. Most TDW mouse operations are 
  53.   similar to Windows mouse operations. In the material that follows,
  54.   we discuss tips for using a mouse under Windows and some uses of 
  55.   the mouse under TDW that are different from Windows mouse usage.
  56.  
  57.   o When the mouse driver is disabled for Windows, it will be disabled
  58.     for TDW as well.  Starting TDW with the mouse support option
  59.     (-p) has no effect unless you enable the Windows mouse driver.
  60.  
  61.   o If you have a mouse driver installed by default, TDW and the
  62.     installation utilities will try to use your mouse. If you 
  63.     don't want to use your mouse during a debugging session, you 
  64.     can use the command-line switch '-p-' to turn the mouse off. 
  65.     You can also set this option in TDWINST in the Options\Input & 
  66.     Prompting dialog box.
  67.  
  68.   o When you're debugging a Windows application that uses the mouse
  69.     and you reset the application and then run the program, it won't
  70.     accept mouse clicks until you make a keyboard entry.
  71.  
  72.   o Using the mouse
  73.  
  74.     -  Most mice provide two or three buttons that allow for various
  75.        functions inside an application. With TDW you can, among other 
  76.        things, use the left mouse button to select options, move items 
  77.        around on the screen, and set breakpoints. 
  78.  
  79.     -  Double-clicking the mouse on an item in a list chooses the item. 
  80.        For instance, in the File|Open dialog box clicking the mouse once 
  81.        just highlights a file. Double-clicking loads the file.
  82.  
  83.     -  The right mouse button has some of the same functionality as the 
  84.        left mouse button, but you can also open local menus within TDW 
  85.        windows by using this button. 
  86.  
  87.   o You can also choose the commands shown at the bottom of the screen, 
  88.     like F1-Help, by using the mouse.
  89.  
  90.  
  91. Answers to common questions
  92. ---------------------------
  93.   Following is a list of the most commonly asked questions about TDW:
  94.  
  95.   1.  Are there any syntactic or parsing differences between Turbo
  96.       Debugger's Pascal expression evaluation and Turbo Pascal's?
  97.  
  98.       a. Turbo Debugger does not support expressions for set
  99.          constructors:
  100.  
  101.           OK:   [4..7]
  102.  
  103.           BAD:  [myvar1..myvar2]   [3+4..7+8]
  104.  
  105.       b. You can't pass constant-string arguments when evaluating
  106.          functions or procedures.
  107.  
  108.           OK:   MyFunc(123)   MyFunc(StringVariable)
  109.  
  110.           BAD:  MyFunc('Constant')
  111.  
  112.                 MyFunc(StringConstant), where StringConstant is
  113.                 defined with a "const" declaration and is not a
  114.                 typed constant.
  115.  
  116.       c. You can't evaluate procedures or functions that have
  117.          structure VALUE parameters. You can evaluate procedures or
  118.          functions that have structure VARIABLE parameters, though.
  119.  
  120.   2.  What should I be aware of when I am debugging multilanguage
  121.       programs with Turbo Debugger?
  122.  
  123.       Turbo Debugger's default source language is "Source," which
  124.       means it chooses the expression language based on the current
  125.       source module. This can cause some confusion if your program
  126.       has source modules written in different languages (like C
  127.       and assembler). Since you are actually entering a language
  128.       expression any time Turbo Debugger prompts you for a value
  129.       or an address, this can cause some unexpected results:
  130.  
  131.       a. Even if you are in a CPU window or a Dump window, you
  132.          must still enter addresses in the source language,
  133.          despite the fact that the window is displaying in hex.
  134.          For example, to display the contents of memory address
  135.          1234:5678, you must type one of the following
  136.          expressions, depending on your current source language:
  137.  
  138.           C            0x1234:0x5678
  139.           Pascal        $1234:$5678
  140.           Assembler     1234H:5678H
  141.  
  142.       b. When your current language is assembler, you must be
  143.          careful when entering hex numbers, since they are
  144.          interpreted EXACTLY as they would be in an assembler
  145.          source file. This means that if you want to enter a
  146.          number that starts with one of the hex digits A - F, you
  147.          must first precede the letter with a 0 so Turbo Debugger
  148.          knows you are entering a number. Likewise, if your number
  149.          ends in B or D (indicating a binary or decimal number), you
  150.          must add an H to indicate that you really want a hex number:
  151.  
  152.           OK:   0aaaa   123dh   89abh
  153.  
  154.           BAD:  aaaa    123d    89ab
  155.  
  156.   3.  Why does the text "Cannot be changed" come up when I do an
  157.       assignment in the Data/Evaluate/Modify "New value" pane?
  158.  
  159.       If you use the Data/Evaluate/Modify command (Ctrl-F4) to
  160.       change a variable by direct assignment, the "New value" pane
  161.       will say "Cannot be changed." This doesn't mean the 
  162.       assignment didn't take effect. What it does mean is that the
  163.       assignment expression as a whole is not a memory-referencing
  164.       expression whose value you can change by moving to the
  165.       bottom pane. Here are some examples of direct assignment
  166.       expressions:
  167.  
  168.         C              x = 4
  169.         Pascal         ratio := 1.234
  170.         Assembler      wval = 4 shl 2
  171.  
  172.       If you had typed just "x," "ratio," or "wval" into the top
  173.       pane, then you would be able to move to the bottom pane and
  174.       enter a new value. The direct assignment method using the
  175.       "=" or ":=" assignment operator is quicker and more
  176.       convenient if you don't care about examining the value of
  177.       the variable before modifying it.
  178.  
  179.  
  180.   4.  What could happen when global breakpoints are set on local
  181.       variables?
  182.  
  183.       When you set global breakpoints using local variables, make
  184.       sure the breakpoints are cleared before you exit the
  185.       procedure or function that the variables are defined in. The
  186.       best way to do this is to put a breakpoint on the last line
  187.       of the procedure or function. If you do not clear the
  188.       breakpoints, your program will break unexpectedly and may
  189.       even hang on some machines because the breakpoints are being
  190.       set in memory that is not currently being used by the
  191.       procedure or function.
  192.  
  193.  
  194.   5.  Why is execution slower when tracing (F7) than when stepping
  195.       (F8) through my programs?
  196.  
  197.       TDW can do reverse execution, which means that when you are 
  198.       tracing through your program, TDW could be saving all the 
  199.       information about each source line you trace over. TDW only 
  200.       saves this information in the Module window if you have chosen 
  201.       View|Execution History and toggled the Full History local menu 
  202.       command to 'Yes'. 
  203.  
  204.       If you want faster execution you can step over (F8) the instruction 
  205.       or toggle the Full History option to 'No' in the Execution History 
  206.       window. (Although reverse execution is always available in the 
  207.       CPU view, you must toggle this option to 'Yes' for it to work 
  208.       in the Module view.  The default setting in the Module view is 'No'.)
  209.  
  210. /************************* END OF FILE *****************************/
  211.  
  212.